<?php
	include dirname(dirname(__FILE__)).'/admin-verify.php';
	include dirname(__FILE__).'/functions.php';
	$ret=getAidApplyInfo();
?>
<html>
	<head>
		<title>资助申请管理</title>
		<?php include dirname(dirname(dirname(__FILE__))).'/include/common-header.php'; ?>
		<script type="text/javascript">
		$(document).ready(function(){

			$(".show").click(function(){
			var val=$.trim($(this).next().val());
				$.post("ajax/show-s_user.php",{val:val},function(result){
					//json=JSON.parse();
					
					var obj = eval('(' + result + ')');  //string 转化 json
					$("#username").html(obj.username);
					$("#student_id").html(obj.student_id);
					$("#department").html(obj.department);
					$("#grade").html(obj.grade);
					$("#user_real_name").html(obj.user_real_name);
					$("#sex").html(obj.sex);
					$("#phone").html(obj.phone);
					
					
					
					
				  });
				});

		});
		</script>
	</head>
	<body>

		<div class="modal fade" id="myModal-show" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
 
<h4 class="modal-title" id="myModalLabel">用户信息</h4>
</div>
<div class="modal-body">
	        <form class="form-horizontal col-md-offset-3">
			  <div class="form-group">
			    <label for="username" class="col-sm-2 control-label">用户名</label>
			    <div class="col-sm-10">
			      <h4 style="width:60%"   id="username" name="username" ></h4>
			    </div>
			  </div>		
			    <div class="form-group">
				    <label for="student_id" class="col-sm-2 control-label">学号</label>
				    <div class="col-sm-10">
				      <h4 style="width:60%" name="student_id"  id="student_id" ></h4>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="department" class="col-sm-2 control-label">学院</label>
				    <div class="col-sm-10">
				      <h4 style="width:60%"  name="department"  id="department" ></h4>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="grade" class="col-sm-2 control-label">年级</label>
				    <div class="col-sm-10">
				      <h4 style="width:60%"  name="grade" id="grade" ></h4>
				    </div>
				  </div>
				  <div class="form-group">
				    <label  for="user_real_name" class="col-sm-2 control-label">姓名</label>
				    <div class="col-sm-10">
				      <h4  style="width:60%"  name="user_real_name" id="user_real_name"></h4>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="sex" class="col-sm-2 control-label">性别</label>
				    <div class="col-sm-10">
				       <h4 style="width:60%" name="sex" id="sex" ></h4>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="phone" class="col-sm-2 control-label">联系方式</label>
				    <div class="col-sm-10">
				      <h4 style="width:60%"  name="phone"  id="phone" ></h4>
				    </div>
				  </div>
			</form>
	      </div>
	    </div>
	  </div>
	</div>
	

			<div class="container">
 						<table class="table table-striped table-bordered table-hover table-condensed " id="default-table">
			  <tr>
			  	<th>用户</th>
			  	<th>附件</th>
			  	<th>申请时间</th>
			  </tr>
			  <?php
			  	while($row=mysql_fetch_array($ret)){
			  	echo '<tr>
			  	<th>'.'<button class="btn btn-primary show" data-toggle="modal" 
										data-target="#myModal-show">'.$row["username"].'</button>'
								.'<input type="hidden" value="'.base64_encode($row['s_user_id']).'"/>'.'</th>
			  	<th>'.'</th>
			  	<th>'.$row["create_time"].'</th>·
			  	';
			  	echo '</tr>';

			  	}

			  		
			  ?>
			  
			</table>
 				</div>

	</body>
</html>